const router = require("koa-router")();
const { check } = require("../../../middleware/routercheck")
const { testpaperApi } = require("../../../controller/examination/testpaper")

const { veri } = require("../../../middleware/checkData")

router.get(
    "/testpaper/byid/:id",
    veri(["id"], "Non empty", "params"),
    check("gettestpaper"),
    testpaperApi)
router.get(
    "/testpaper/list",
    veri(["pageNum", "pageSize"], "Non empty", "query"),
    check("gettestpaper"),
    testpaperApi)
router.post(
    "/testpaper/add",
    veri(["title","starttime","endtime"], "Non empty", "request"),
    check("createtestpaper"),
    testpaperApi)
router.put(
    "/testpaper/edit/:id",
    veri(["id"], "Non empty", "params"),
    check("edittestpaper"),
    testpaperApi)
router.delete(
    "/testpaper/remove/:id",
    veri(["id"], "Non empty", "params"),
    check("removetestpaper"),
    testpaperApi)

module.exports = router


